<?php defined('SYSPATH') or die('No direct script access.');
 
	class Controller_Role extends Controller{
		
		public function action_index(){
						
			$view = View::factory("page");
			$view->page_title = "Roles";
			$view->pre_content = "";
			$view->post_content = "";
			
			$grid = new Jqgrid("role", Helper_Service::factory("role"));
			$view->page_content = $grid->render("jqgrid/config/role"); 
			
			$this->request->response = $view->render();	
		}
		
		public function action_list(){
			$grid = new Jqgrid("role", Helper_Service::factory("role"));
			
			$criteria = new Jqgrid_Criteria();
			$criteria->page = $_POST['page'];
			$criteria->limit = $_POST['rows'];
			$criteria->sidx = $_POST['sidx'];
			$criteria->sord = $_POST['sord'];
			
			$this->request->response = $grid->getList($criteria);
		}
		
		public function action_save(){
			$grid = new Jqgrid("role", Helper_Service::factory("role"));
			$this->request->response = $grid->save($_POST['oper'],$_POST);
		}
		
	}


// End Role ?>
